home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
program
/
385
/
prg_1
/
prg_1ap.s
< prev
next >
Wrap
Text File
|
1985-11-19
|
3KB
|
63 lines
; Program Name: PRG_1AP.S
; Version: 1.001
; Assembly Instructions:
; 1. Assemble in AssemPro PC-relative mode and save the assembled
; program with a PRG extension, then save it with a TOS extension.
; 2. Click on the PC-relative option under the Assembler menu to activate
; the Absolute assembly mode. The Absolute mode is active when there
; is no check mark in front of the PC-relative option and no check mark
; in front of the Relocatable option. Change the name of the source
; file to PRG_1AA. Do this by clicking on the File option under the
; File menu and, in the dialog box that appears, backspace over the
; letter P and type an A. Do not save the new source file, but
; assemble it and save the assembled program with a PRG extension,
; then save it with a TOS extension.
; 3. Click on the Relocatable option under the Assembler menu.
; Change the name of the source file to PRG_1AR. Do not save the
; source file, but assemble in the Relocatable mode and save with
; PRG and TOS extensions.
; Program Function:
; This program invokes a single GEMDOS function. That function performs
; three services. It relinquishes processor control, prohibits execution
; beyond the program's upper boundary and removes the program from ram.
; Program Purpose:
; To introduce the smallest possible ST program. Every ST program must
; accomplish at least two functions. It must relinquish processor control,
; and it must prevent execution beyond its boundaries. Processor control
; must be relinquished at some time during the life of each program, if for
; no other reason, then because all programs must eventually finish the
; task for which they were invoked. Without some sort of demarcating code
; within an executing program, the processor will continue to try to execute
; whatever is in memory, until a fatal error eventually occurs.
; GEMDOS function $0, also known as (aka) p_term_old, term or terminate,
; may be invoked to perform these two functions. But, in addition, this
; function also removes the program from memory.
; When GEMDOS $0 is invoked, processor control is returned to the
; agent that initiated the execution of the program that is now invoking
; GEMDOS $0. That agent may be the Desktop or some other program.
; An additional purpose of this exercise is to compare the sizes of
; the code files produced by the three assembly modes. Furthermore, if
; you are able to carefully observe the length of time it takes to execute
; each type of program, where the mode of assembly indicates "type", you
; will see that the time required to execute the Relocatable types is longer
; than the time required to execute the other types.
terminate: ; My descriptive label.
move.w #0, -(sp) ; Function = p_term_old = GEMDOS $0.
trap #1 ; GEMDOS call.
end ; Assembler pseudo-op.